<?php
//$intOrderHeaderID = 18;
if (defined("SITE")){
	$strSite = SITE;
	//$strSite.sprintf("%08d",$intOrderHeaderID)
}
include (MODULE_SHOP_HOST . "/navigation/EmailHeader");
include (MODULE . "/action/qrySelectOrderHeader");
$strDeliveryName 		= 	$myrow["DeliveryName"];
$strDeliveryAddress 	=	$myrow["DeliveryAddress"];
$strDeliveryAddress2 	=  	$myrow["DeliveryAddress2"];
$strDeliveryCity 		= 	$myrow["DeliveryCity"];
$strDeliveryRegion 		= 	$myrow["DeliveryRegion"];
$strDeliveryPostalCode 	= 	$myrow["DeliveryPostalCode"];
unset($intTotal);
//STYLE='table-layout: fixed'?>
<link rel="stylesheet" href='http://<?=$SERVER_NAME?>/shop.css'>
	<table width='600' height='1000' align='center' class='Normal' border='0'  bgcolor='White'>
	<tr align='left' valign='top'>
		<td colspan='6'  width='600' height='100'><img src='http://<?=$SERVER_NAME?>/images<?=SITE_SUFFIX?>/EmailHeader.jpg' width='600' align='top' border='0'/></td>
	</tr>

	<tr VALIGN=TOP>
		<td colspan='6' align='center'  height='70'>
			<h1 class='orderheading'>Delivery Note</h1>
		</td>
	</tr>
	<tr VALIGN=TOP>
		<td colspan='3' align='left' class='Normal' height='40'>
			<b>Order Number:</b><?=$strSite.sprintf("%08d",$intOrderHeaderID)?>
		</td>
		<td colspan='3' align='right'  height='40'>
			<b>Estimated Dispatch Date:</b><?=ReformatFromMySqlDate($myrow["ShippedDate"])?>
		</td>
	</tr>
	
	<tr>
		<td colspan='3' valign='top'  height='170'>
			<span style="font-size:11px">
			<br/><b>Sold to:</b>
			<br/><br/><?=$myrow["ShipName"]?>
			<br/><?
				echo $myrow["ShipAddress"];

				if ($myrow["ShipAddress2"]){
					echo "<br/>".$myrow["ShipAddress2"];
				}?>
		
			<br/><?=$myrow["ShipCity"]?>
			<br/><?=$myrow["ShipRegion"]?>
			<br/><?=$myrow["ShipPostalCode"]?>
			</span>
		</td>

		<td colspan='3' valign='top'>
			<span style="font-size:11px">
			<br/><b>Deliver to:</b>
			<br/><br/><?=$myrow["DeliveryName"]?>
			<br/><? 
			echo $myrow["DeliveryAddress"];

				if ($myrow["DeliveryAddress2"]){
					echo "<br/>".$myrow["DeliveryAddress2"];
				}?>

			<br/><?=$myrow["DeliveryCity"]?>
			<br/><?=$myrow["DeliveryRegion"]?>
			<br/><?=$myrow["DeliveryPostalCode"]?>
			</span>
		</td>
	</tr>
	
	<tr>
		<td colspan='6' align='left'  height='20'><?
			if(EXTRA_ORDER_FIELD){
				echo "<br/><b>".EXTRA_ORDER_FIELD."</b>".$myrow["OtherInfo"]."<br/>";
			}?>
		</td>
	</tr>
	
	<tr align='center' height='20'>
        <td align='left' width='230'><b>Product</b></td>
		<td align='center' width='30'><b>qty</b></td>
		<td align='center' width='60'>&nbsp;</td>
		<td align='center' width='90'>&nbsp;</td>
		<td align='center' width='80'>&nbsp;</td>
		<td align='right' width='120'>&nbsp;</td>
    </tr><?
	
	include (MODULE . "/action/qrySelectOrderDetails");
	do{?>
		<tr align='right' bgcolor="<?=switch_background($boBG)?>">
	 		<td align='left' height='20'><?
			
					if ($myrow["QuantityPerUnit"]>1){
						echo $myrow["QuantityPerUnit"]."&nbsp;";
					}
					
				echo $myrow["Product"];?>
			</td>
			<td><?=$myrow["Quantity"]?></td>
			<td>&nbsp;</td>
	        <td>&nbsp;</td>
	        <td>&nbsp;</td>
			<td>&nbsp;</td>
	    </tr><?
	    $boBG = -1 - $boBG; //alternate $boBG values from -1 and 0
	} while ($myrow = mysql_fetch_array($result));?>

	<tr>
        <td colspan='6' align='left'  height='20'>&nbsp;</td>
    </tr>
	
	<tr>
 		<td colspan='6'  height='20' align='center'><?=DELIVERY_NOTE_MESSAGE?></td>
    </tr>

	<tr valign='bottom' height='30'>
 		<td colspan='6' align='center' class='small' height='30'>

			&nbsp;
		</td>
    </tr>
	
	<tr valign='bottom' height='1'>
 		<td colspan='6' align='center' class='small' height='1' bgcolor='silver'>
			<img src='./images/space.gif' height='1' border='0' alt=''>
		</td>
    </tr>

	
	<tr valign='bottom'>
 		<td colspan='6' align='center' class='small' height='30'>
			<table border='0' cellpadding='2' width='100%' class='small'>
				<tr height='30'>
					<td width='100%'>
						<b>Order No:</b>&nbsp;<?=$intOrderHeaderID?>
					</td>
				</tr>
			</table>
		</td>
    </tr>
	
	<tr valign='bottom' height='1'>
 		<td colspan='6' align='center' class='small' height='1' bgcolor='silver'>
			<img src='./images/space.gif' height='1' border='0' alt=''>
		</td>
    </tr>
	
	<tr valign='bottom' height='20'>
 		<td colspan='6' align='center' class='small' height='30'>
			<table border='0' cellpadding='2' width='100%' class='small'>
				<tr height='30'>
					<td width='100%'>
						<b>Order No:</b>&nbsp;<?=$intOrderHeaderID?>
					</td>
				</tr>
			</table>
		</td>
    </tr>
	
	<tr valign='bottom' height='1'>
 		<td colspan='6' align='center' class='small' height='1' bgcolor='silver'>
			<img src='./images/space.gif' height='1' border='0' alt=''>
		</td>
    </tr>
	
	<tr valign='bottom'>
		<td colspan='6'>
			<table border='0' cellpadding='2' width='100%' class='Normal'>
				<tr valign='top' height='100'>
					<td width='150'>&nbsp;</td>
					<td colspan='1' >
						<br/><br/>If undelivered Tabernus Ltd, CO4 5NE 
					</td>
				
				</tr>
				<tr valign='top' height='250'>
					<td width='150'>&nbsp;</td>
					<td width='100%' align='left'>
						<span style="font-size:11px">
						<br/><br/><?=$strDeliveryName?>
						<br/><?
							echo $strDeliveryAddress;
			
							if ($strDeliveryAddress2){
								echo "<br/>".$strDeliveryAddress2;
							}?>
		

						<br/><?=$strDeliveryCity?>
						<br/><?=$strDeliveryRegion?>
						<br/><?=$strDeliveryPostalCode?>
						</span>
					</td>
				</tr>
				<tr valign='top' height='50'>
					<td colspan="2" align="left"><?=$strSite.sprintf("%08d",$intOrderHeaderID)?></td>
				
				</tr>
			</table>
		</td>
    </tr>
	
</table>
